package com.gzsxy.esjy.feign.Product;


import com.gzsxy.esjy.service.base.dto.response.DefaultResponse;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;



//fallbackFactory是降级熔断工厂，异常统一进入对应的类
@FeignClient(value = "service-product", fallbackFactory = ProductFallback.class, fallback = ProductClientHystrix.class)
public interface ProductFeignService {

    /**
     * @param productId 商品id
     * @return
     * @description:  根据商品id查询对应的图片
     */
    @GetMapping(value = "/admin/productPic/{productId}")
    public DefaultResponse getPicByProductId(@PathVariable String productId);



    /**
     * @description: 根据商品id查询商品(外部服务调用)
     * @param id 商品id
     * @return
     */
    @GetMapping(value = "/admin/product/{id}")
    public DefaultResponse getProductById(@PathVariable String id);


    /**
     * @description: 修改商品库存
     * @param
     * @return
     */
    @GetMapping(value = "/admin/product/editNumber/{id}")
    public DefaultResponse editNumber(@PathVariable String id, Integer number);
}
